<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>My OJ ‑ Start Coding</title>
    <style>
        /*========= 设计变量 =========*/
        :root {
            --primary: #00c896;
            --primary-dark: #009e78;
            --bg-start: #0f172a;
            --bg-end: #1e293b;
            --glass: rgba(30, 41, 59, .55);
            --radius: 12px;
            --shadow: 0 8px 32px rgba(0, 0, 0, .37);
            --font-color: #e2e8f0;
            --font-dark: #94a3b8;
        }

        /*========= 通用 reset =========*/
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body, html {
            width: 100%;
            height: 100%;
            font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            color: var(--font-color);
            overflow-x: hidden;
        }

        /*========= 背景 & 粒子 =========*/
        #particles {
            position: fixed;
            inset: 0;
            z-index: -1;
            background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
        }

        /*========= 导航栏 =========*/
        header {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 64px;
            background: var(--glass);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border-bottom: 1px solid rgba(255, 255, 255, .05);
            z-index: 1000;
        }
        nav {
            max-width: 1200px;
            margin: 0 auto;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 24px;
        }
        .logo {
            font-size: 22px;
            font-weight: 700;
            letter-spacing: 1px;
            color: var(--primary);
        }
        .nav-links {
            display: flex;
            gap: 32px;
            align-items: center;
        }
        .nav-links a {
            color: var(--font-dark);
            text-decoration: none;
            font-size: 15px;
            transition: color .2s;
        }
        .nav-links a:hover {
            color: var(--primary);
        }
        .nav-btn {
            background: var(--primary);
            color: #fff;
            padding: 8px 18px;
            border-radius: var(--radius);
            font-weight: 600;
            transition: background .2s;
        }
        .nav-btn:hover {
            background: var(--primary-dark);
        }
        /* 汉堡按钮（手机） */
        .hamburger {
            display: none;
            flex-direction: column;
            gap: 5px;
            cursor: pointer;
        }
        .hamburger span {
            width: 24px;
            height: 2px;
            background: var(--font-color);
            transition: .3s;
        }

        /*========= 主内容卡片 =========*/
        main {
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
        }
        .card {
            background: var(--glass);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid rgba(255, 255, 255, .06);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            padding: 60px 48px;
            max-width: 640px;
            text-align: center;
            animation: fadeIn .8s ease-out;
        }
        .card h1 {
            font-size: 36px;
            margin-bottom: 16px;
            letter-spacing: .5px;
        }
        .card p {
            color: var(--font-dark);
            margin-bottom: 36px;
            font-size: 18px;
            line-height: 1.6;
        }
        .cta {
            display: inline-block;
            background: var(--primary);
            color: #fff;
            padding: 14px 36px;
            border-radius: var(--radius);
            font-weight: 600;
            text-decoration: none;
            transition: transform .2s, background .2s;
        }
        .cta:hover {
            background: var(--primary-dark);
            transform: translateY(-2px);
        }

        /*========= 动画 =========*/
        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /*========= 响应式 =========*/
        @media (max-width: 768px) {
            .nav-links {
                position: absolute;
                top: 64px;
                right: 24px;
                flex-direction: column;
                background: var(--glass);
                backdrop-filter: blur(12px);
                border-radius: var(--radius);
                padding: 20px 24px;
                gap: 20px;
                opacity: 0;
                pointer-events: none;
                transform: translateY(-10px);
                transition: .3s;
            }
            .nav-links.active {
                opacity: 1;
                pointer-events: auto;
                transform: translateY(0);
            }
            .hamburger {
                display: flex;
            }
        }
    </style>
</head>
<body>
    <!-- 粒子背景 -->
    <canvas id="particles"></canvas>

    <!-- 导航栏 -->
    <header>
        <nav>
            <div class="logo">MyOJ</div>
            <div class="nav-links" id="navLinks">
                <a href="/">首页</a>
                <a href="/all_questions">题库</a>
                <a href="#">竞赛</a>
                <a href="#">讨论</a>
                <a href="#">求职</a>
                <a class="nav-btn" href="#">登录</a>
                <a class="nav-btn" href="#">注册</a>
            </div>
            <div class="hamburger" id="hamburger">
                <span></span><span></span><span></span>
            </div>
        </nav>
    </header>

    <!-- 主内容 -->
    <main>
        <section class="card">
            <h1>欢迎来到 MyOJ</h1>
            <p>这是我独立开发的在线判题平台，简洁、快速、极客。</p>
            <a class="cta" href="/all_questions">开始刷题</a>
        </section>
    </main>

    <script>
        /*========= 手机端菜单切换 =========*/
        const hamburger = document.getElementById('hamburger');
        const navLinks = document.getElementById('navLinks');
        hamburger.addEventListener('click', () => navLinks.classList.toggle('active'));

        /*========= 粒子背景 =========*/
        const canvas = document.getElementById('particles');
        const ctx = canvas.getContext('2d');
        let particlesArray;

        function resize() {
            canvas.width = window.innerWidth;
            canvas.height = window.innerHeight;
        }
        window.addEventListener('resize', resize);
        resize();

        class Particle {
            constructor() {
                this.x = Math.random() * canvas.width;
                this.y = Math.random() * canvas.height;
                this.size = Math.random() * 1.5 + 1;
                this.speedX = (Math.random() - 0.5) * 0.4;
                this.speedY = (Math.random() - 0.5) * 0.4;
            }
            update() {
                this.x += this.speedX;
                this.y += this.speedY;
                if (this.x < 0 || this.x > canvas.width) this.speedX *= -1;
                if (this.y < 0 || this.y > canvas.height) this.speedY *= -1;
            }
            draw() {
                ctx.fillStyle = 'rgba(0, 200, 150, 0.55)';
                ctx.beginPath();
                ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);
                ctx.fill();
            }
        }

        function init() {
            particlesArray = [];
            for (let i = 0; i < 100; i++) particlesArray.push(new Particle());
        }
        init();

        function animate() {
            ctx.clearRect(0, 0, canvas.width, canvas.height);
            for (let p of particlesArray) {
                p.update();
                p.draw();
            }
            requestAnimationFrame(animate);
        }
        animate();
    </script>
</body>
</html>